#!/bin/bash

workdir=$1
workdir=`./ab-dir.sh ${workdir}`

#execute the reduce scripts
redscripts=${workdir}/reduce;
if [ -e "${redscripts}" ];
then
echo "INFO:	Find reduce dir @ ${redscripts}"
cd ${redscripts}
for rf in `ls *.sh`;
do
echo "INFO:	Command:	${rf} ${workdir}"
./${rf} "${workdir}"
echo "INFO: Done:	 ${rf}"
done
else
echo "INFO:	No reduce folder, so will not run reduce !"
fi